<!DOCTYPE html>
<html lang="">
	<head>
		<meta charset="utf-8" />
		<meta http-equiv="X-UA-Compatible" content="IE=edge" />
		<meta name="viewport" content="width=device-width,initial-scale=1.0" />
		<link rel="icon" href="<%= BASE_URL %>favicon.ico" />
		<title><%= htmlWebpackPlugin.options.title %></title>
	</head>
	<body>
		<noscript>
			<strong
				>We're sorry but <%= htmlWebpackPlugin.options.title %> doesn't work
				properly without JavaScript enabled. Please enable it to
				continue.</strong
			>
		</noscript>
		<script></script>
		<script type="text/javascript">
			window.onscroll=function(){
			var topScroll =window.pageYOffset;//滚动的距离,距离顶部的距离
			//alert(topScroll);
			var bignav = document.getElementById("nav");//获取到导航栏id
			if(topScroll > 500){ //当滚动距离大于250px时执行下面的东西
			bignav.style.position = 'fixed';
			bignav.style.top = '0';
			bignav.style.zIndex = '9999';
			}else{//当滚动距离小于250的时候执行下面的内容，也就是让导航栏恢复原状
			bignav.style.position = 'static';
			}
			}
			</script>
			
			作者：捔落纏綿
			链接：https://www.jianshu.com/p/871dc31b3146
			来源：简书
			著作权归作者所有。商业转载请联系作者获得授权，非商业转载请注明出处。
		<div id="app"></div>
		<!-- built files will be auto injected -->
	</body>
</html>
